package cn.school.controller.iot;

import cn.school.common.api.CommonResult;
import cn.school.iot.service.FaceGateRuleTimePeriodService;
import cn.school.iot.service.StuFaceGateRuleService;
import cn.school.iot.vo.StuGateRuleParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description: 学生闸机规则Controller
 * @ClassName: StuFaceGateController
 * @Author: tzw
 * @Date: 2024/4/9 16:33
 */
@RestController
@RequestMapping("/faceGateRule")
public class StuFaceGateController {

    @Resource
    private StuFaceGateRuleService stuFaceGateRuleService;

    @PostMapping("/addOrUpdateStuGateRule")
    public CommonResult addOrUpdateDeviceRule(@RequestBody StuGateRuleParam stuGateRuleParam) {
        boolean result = stuFaceGateRuleService.addOrUpdateDeviceRule(stuGateRuleParam);
        if (result){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }

}
